package top.infopub.mgr.mkt.web;

import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.infopub.mgr.common.page.ParamPage;
import top.infopub.mgr.common.vo.RspVo;
import top.infopub.mgr.flow.web.GenericFlowController;
import top.infopub.mgr.mkt.domain.BidCurrencyDomain;
import top.infopub.mgr.mkt.service.BidReviewService;
import top.infopub.mgr.mkt.vo.BidCurrencyVo;

import java.text.ParseException;

/**
 * @Author Warking
 * @Date 2021/4/28 19:23
 * @Version 1.0
 */
@Controller
@RequestMapping("/bidReview")
public class BidReviewController extends GenericFlowController {
    @Autowired
    private BidReviewService bidReviewService;

    @RequestMapping("/queryDataByCondition")
    @ResponseBody
    public RspVo<BidCurrencyDomain> queryDataByCondition(BidCurrencyVo bidCurrencyVo, ParamPage paramPage) throws ParseException {
        Page<BidCurrencyDomain> page = new Page<BidCurrencyDomain>();
        page.setPageNum(paramPage.getPage());
        page.setPageSize(paramPage.getLimit());
        page = bidReviewService.selectPage(page,bidCurrencyVo);
        return RspVo.getSuccessResponse(page.getTotal(),page.getResult());
    }


}
